import axiosInstance from '../untils/request'
import type { IResponse } from '@/types/type'

/* 产品列表*/
//定义参数         和    返回的对象的数据类型
//                                           定义参数         和    返回的对象的数据类型
export const RequestShopList = (pageNo: number, pageSize: number): Promise<IResponse> => {
    return axiosInstance({
        method: 'get',
        url: '/api/shop',
        params: {
            pageSize,
            pageNo,
        }
    })
}
/**
 * 轮播
 */
export const RequestBanner = (): Promise<IResponse> => {
    return axiosInstance({
        method: 'get',
        url: '/api/banner'
    })
}

//登录接口
export const RequestLogin = (username: string, password: string): Promise<IResponse> => {
    return axiosInstance({
        method: 'post',
        url: '/api/member/login',
        data: {
            username,
            password,
        }
    })
}
//注册接口
export const RequestRegister = (username: string, password: string, headerimg: string): Promise<IResponse> => {
    return axiosInstance({
        method: 'post',
        url: '/api/member/add',
        data: {
            username,
            password,
            headerimg,
        }
    })
}
